import React from "react";
import { NavLink } from "react-router-dom";

import style from './index.module.css'
const {getvip,jump,checkMark} = style

export interface IuserRealName {
    ID:string,
    hometown:string,
    house:string,
    name:string,
    realName:boolean
}

interface Iprops {
    leftMessage:string,
    rightMessage?:string,
    routerPush:string,
    color?:string,
    User?:IuserRealName
}

export default function Getvip(props:Iprops){

    let leftMessage:string
    props.User?.realName ? leftMessage = '已实名' : leftMessage = props.leftMessage
    return (
        <div className={getvip}>
            
            <div style={{color:props.color}}>
            {   props.User?.realName &&
                <p className={checkMark}></p>
            } 
                {leftMessage}
            </div>
            <NavLink className={jump} to={{pathname:props.routerPush,state:props.User}}>
                <span>{props.rightMessage}</span>
                <span></span>
            </NavLink>
        </div>
    )
}